package com.zmn.oms.common.constant;

import java.util.*;

/**
 * 类描述：工单附件类型常量
 *
 * @author liuying
 * @date 2021/06/14 11:37
 */
public class OrderAttachmentConsts {

    /**
     * 维修前
     */
    public static final int BEFORE_REPAIR = 21;
    /**
     * 维修中
     */
    public static final int IN_REPAIR = 22;
    /**
     * 维修后
     */
    public static final int AFTER_REPAIR = 23;

    /**
     * 工程师形象照
     */
    private static final int GCSXXZ = 99;

    /**
     * 其它照片
     */
    private static final int QTFWZ = 98;

    /**
     * 贴花照
     */
    private static final int THZP = 97;



    /**
     * 审核无效
     */
    public final static int REVIEW_STATUS_FAIL = 1;
    /**
     * 审核有效
     */
    public final static int REVIEW_STATUS_VALID = 2;

    /**
     * 装备照上传标准地址
     */
    public final static String UPLOAD_STANDARD_ZBZ_URL="https://alidocs.dingtalk.com/document/edit?dentryKey=pWrL03ZGJFQnW33O&type=d&dd_user_keyboard=false&dt_editor_toolbar=true&dd_close=false&biz_ver=10&workspaceId=9JOGOybqplyvnX4Q&nodeId=9JOGOOdPbgwdJG4Q&corpId=ding604c3166bcf39424#";

    /**
     * 厨卫翻新
     */
    public final static List<OrderAttachmentTypeEnum> KITCHEN_TOILET_LIST = new ArrayList<OrderAttachmentTypeEnum>() {{
        add(OrderAttachmentTypeEnum.YBJD);
        add(OrderAttachmentTypeEnum.SJTZ);
        add(OrderAttachmentTypeEnum.ZCQD);
        add(OrderAttachmentTypeEnum.SGHT);
        add(OrderAttachmentTypeEnum.JCGDZP);
        add(OrderAttachmentTypeEnum.SDGZGDZP);
        add(OrderAttachmentTypeEnum.SDYSD);
        add(OrderAttachmentTypeEnum.FSGDZP);
        add(OrderAttachmentTypeEnum.FSYSD);
        add(OrderAttachmentTypeEnum.TZGDZ);
        add(OrderAttachmentTypeEnum.TZYSD);
        add(OrderAttachmentTypeEnum.SWGDZ);
        add(OrderAttachmentTypeEnum.SWYSZ);
        add(OrderAttachmentTypeEnum.JGGDZ);
        add(OrderAttachmentTypeEnum.JGYSD);
    }};
    /**
     * 厨卫翻新（非必传）
     */
    public final static Set<OrderAttachmentTypeEnum> KITCHEN_TOILET_NON_MUST_SET = new HashSet<OrderAttachmentTypeEnum>() {{
        add(OrderAttachmentTypeEnum.SJTZ);
        add(OrderAttachmentTypeEnum.SDGZGDZP);
        add(OrderAttachmentTypeEnum.SDYSD);
        add(OrderAttachmentTypeEnum.FSGDZP);
        add(OrderAttachmentTypeEnum.FSYSD);
        add(OrderAttachmentTypeEnum.TZGDZ);
        add(OrderAttachmentTypeEnum.TZYSD);
        add(OrderAttachmentTypeEnum.SWGDZ);
        add(OrderAttachmentTypeEnum.SWYSZ);
    }};

    /**
     * 不检查附件照片
     */
    public final static Set<Integer> NOT_CHECK = new HashSet<Integer>() {{
        add(OrderAttachmentTypeEnum.CONSTS_ZBZ);
        add(OrderAttachmentTypeEnum.CONSTS_XXZ);
    }};

    /**
     * 转化为订单图片类型
     *
     * @param pictureType
     * @return
     * @see com.zmn.plat.common.dictionary.ChannelWorkOrderPictureTypeEnum
     */
    public static Integer getOrderAttachmentPictureTypeByChannelPictureType(Integer pictureType) {
        return pictureType;
    }

    /**
     * 转化为订单视频类型
     *
     * @param videoType
     * @return
     * @see com.zmn.oms.common.constant.OrderAttachmentTypeEnum
     */
    public static Integer getOrderAttachmentVideoTypeByChannelVideoType(Integer videoType) {
        if (Objects.isNull(videoType)) {
            return 0;
        }

        switch (videoType) {
            case 1:
                return BEFORE_REPAIR;
            case 2:
                return IN_REPAIR;
            case 3:
                return AFTER_REPAIR;
        }

        return 0;
    }

    /**
     * 判断是否为视频类型
     *
     * @param videoType
     * @return
     */
    public static boolean isVideoType(Integer videoType) {
        if (Objects.isNull(videoType)) {
            return false;
        }
        return videoType == BEFORE_REPAIR || videoType == IN_REPAIR || videoType == AFTER_REPAIR;
    }

    /**
     * 获取视频图片类型名称
     *
     * @param videoType
     * @return
     */
    public static String getVideoTypeName(Integer videoType) {
        if (Objects.isNull(videoType)) {
            return "";
        }

        switch (videoType) {
            case BEFORE_REPAIR:
                return "服务前";
            case IN_REPAIR:
                return "服务中";
            case AFTER_REPAIR:
                return "服务后";
        }
        return "";
    }

    /**
     * 审核结果
     *
     * @param type 审核状态
     * @return 审核状态名称
     */
    public static String getReviewResultName(Integer type) {
        if (Objects.isNull(type)) {
            return "";
        }
        switch (type) {
            case REVIEW_STATUS_VALID:
                return "通过";
            case REVIEW_STATUS_FAIL:
                return "不通过";
            default:
                return "";
        }
    }

}
